package com.kayt.cyberBar.cuser.business.entity.po;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * BUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "b_user")
public class BUser implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 5269205255703465900L;
	private Long id;
	private String userCode;
	private String userName;
	private String account;
	private String statusCode;
	private String createTime;
	private String updateTime;
	private String isRegist;
	private BUserDetail userDetail;
	private BUserPicture userPicture;
	private BUserPassword password;
	private BUserRole userRole;
	private BOrganizationDepartUser organizationDepartUser;
	private BSheetUserWork sheetUserWork;
	private List<BUserLabl> bUserLabl;
	// Constructors

	/** default constructor */
	public BUser() {
	}

	/** full constructor */
	public BUser(String userCode, String statusCode, String createTime, String updateTime) {
		this.userCode = userCode;
		this.statusCode = statusCode;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "USER_CODE", length = 60)
	public String getUserCode() {
		return this.userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	@Column(name = "STATUS_CODE", length = 64)
	public String getStatusCode() {
		return this.statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	@Column(name = "USER_NAME", length = 64)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "CREATE_TIME", length = 64)
	public String getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	@Column(name = "UPDATE_TIME", length = 64)
	public String getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "ACCOUNT", length = 64)
	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name = "IS_REGIST", length = 64)
	public String getIsRegist() {
		return isRegist;
	}

	public void setIsRegist(String isRegist) {
		this.isRegist = isRegist;
	}

	@OneToMany(targetEntity = BUserLabl.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = false, mappedBy = "bUser")
	public List<BUserLabl> getbUserLabl() {
		return bUserLabl;
	}

	public void setbUserLabl(List<BUserLabl> bUserLabl) {
		this.bUserLabl = bUserLabl;
	}

	@OneToOne(targetEntity = BUserDetail.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BUserDetail getUserDetail() {
		return userDetail;
	}

	public void setUserDetail(BUserDetail userDetail) {
		this.userDetail = userDetail;
	}

	@OneToOne(targetEntity = BUserPassword.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BUserPassword getPassword() {
		return password;
	}

	public void setPassword(BUserPassword password) {
		this.password = password;
	}

	@OneToOne(targetEntity = BUserPicture.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BUserPicture getUserPicture() {
		return userPicture;
	}

	public void setUserPicture(BUserPicture userPicture) {
		this.userPicture = userPicture;
	}

	@OneToOne(targetEntity = BUserRole.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BUserRole getUserRole() {
		return userRole;
	}

	public void setUserRole(BUserRole userRole) {
		this.userRole = userRole;
	}

	@OneToOne(targetEntity = BOrganizationDepartUser.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BOrganizationDepartUser getOrganizationDepartUser() {
		return organizationDepartUser;
	}

	public void setOrganizationDepartUser(BOrganizationDepartUser organizationDepartUser) {
		this.organizationDepartUser = organizationDepartUser;
	}

/*	@OneToOne(targetEntity = BUserStatus.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BUserStatus getUserStatus() {
		return userStatus;
	}

	public void setUserStatus(BUserStatus userStatus) {
		this.userStatus = userStatus;
	}*/

	@OneToOne(targetEntity = BSheetUserWork.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_CODE", referencedColumnName = "USER_CODE", nullable = true, insertable = false, updatable = false)
	public BSheetUserWork getSheetUserWork() {
		return sheetUserWork;
	}

	public void setSheetUserWork(BSheetUserWork sheetUserWork) {
		this.sheetUserWork = sheetUserWork;
	}

}